package cn.rkylin.oms.order.adapter;

import java.util.Date;
import java.util.List;
import java.util.Map;

import cn.rkylin.oms.order.domain.Order;
import cn.rkylin.oms.order.vo.TaoBaoOrder;
import cn.rkylin.oms.system.shop.domain.Shop;

/**
 * 订单代理，负责与具体的电商平台对接
 * 
 * @author wangxiaoyi
 * @version 1.0
 * @created 13-1月-2017 09:11:14
 */
public abstract class OrderVisitor {

	public void finalize() throws Throwable {

	}

	/**
	 * 构造函数
	 */
	public OrderVisitor() {

	}

	/**
	 * 获取指定时间范围内的订单列表
	 * 
	 * @param startTime
	 * @param endTime
	 * @param paramMap
	 */
	public abstract int getOrderList(Date startTime, Date endTime, Map<String, String> paramMap);

	/**
	 * 获取1个订单
	 * 
	 * @param orderNumber
	 * @param paramMap
	 */
	public abstract Order getOrder(String orderNumber, Map<String, String> paramMap);

	/**
	 * 保存平台订单
	 */
	protected abstract void saveOrder();

	private int restVisit() {
		return 0;
	}

	private int webserviceVisit() {
		return 0;
	}

	private int rmiVisit() {
		return 0;
	}

	/**
	 * 获取指定时间范围内的订单列表
	 * 
	 * @param paramMap
	 */
	public abstract List<Order> getOrderList(Map<String, String> paramMap);

	/**
	 * 获取trade,order 列表
	 * 
	 * @param paramMap
	 */
	public abstract Map<String, Object> getOrderObject(Map<String, Object> paramMap);

	/**
     * 获取trade,order 列表
     * 
     * @param paramMap
     */
    public abstract void getOrderObjectList(Map<String, Object> paramMap, Integer startRow,Integer endRow, List<TaoBaoOrder> loopList);

	/**
	 * 获取trade,order 列表
	 * 
	 * @param paramMap
	 */
	public abstract Map<String, Object> getOrderObject(String tid, Shop shopVO);

	/**
	 * 平台发货
	 * 
	 * @param paramMap
	 *            return 结果Map
	 * @throws Exception
	 *             异常
	 */
	public abstract Map<String, Object> consign(Map<String, Object> paramMap) throws Exception;

}